/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Persistencia;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 *
 * @author veinti
 */
@Entity
@Table(name = "sesion")
@NamedQueries({
    @NamedQuery(name = "Sesion.findAll", query = "SELECT s FROM Sesion s"),
    @NamedQuery(name = "Sesion.findByIdSesion", query = "SELECT s FROM Sesion s WHERE s.idSesion = :idSesion"),
    @NamedQuery(name = "Sesion.findByFecha", query = "SELECT s FROM Sesion s WHERE s.fecha = :fecha"),
    @NamedQuery(name = "Sesion.findByEvolucionLogros", query = "SELECT s FROM Sesion s WHERE s.evolucionLogros = :evolucionLogros"),
    @NamedQuery(name = "Sesion.findByProgresoTerapia", query = "SELECT s FROM Sesion s WHERE s.progresoTerapia = :progresoTerapia"),
    @NamedQuery(name = "Sesion.findByRecomendaciones", query = "SELECT s FROM Sesion s WHERE s.recomendaciones = :recomendaciones"),
    @NamedQuery(name = "Sesion.findByVideo", query = "SELECT s FROM Sesion s WHERE s.video = :video"),
    @NamedQuery(name = "Sesion.findByEstado", query = "SELECT s FROM Sesion s WHERE s.estado = :estado")})
public class Sesion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_sesion")
    private Integer idSesion;
    @Column(name = "fecha")
    private String fecha;
    @Column(name = "evolucion_logros")
    private String evolucionLogros;
    @Column(name = "progreso_terapia")
    private String progresoTerapia;
    @Column(name = "recomendaciones")
    private String recomendaciones;
    @Column(name = "video")
    private String video;
    @Column(name = "estado")
    private String estado;
    @OneToMany(mappedBy = "sesion")
    private List<Tratamiento> tratamientoList;
    @OneToOne(cascade = CascadeType.ALL, mappedBy = "sesion")
    private Informe informe;
    @JoinColumn(name = "id_paciente", referencedColumnName = "id_paciente")
    @ManyToOne(optional = false)
    private Paciente paciente;
    @JoinColumn(name = "id_fisioterapeuta", referencedColumnName = "id_fisioterapeuta")
    @ManyToOne(optional = false)
    private Fisioterapeuta fisioterapeuta;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "sesion")
    private List<Comentariovideo> comentariovideoList;

    public Sesion() {
    }

    public Sesion(Integer idSesion) {
        this.idSesion = idSesion;
    }

    public Integer getIdSesion() {
        return idSesion;
    }

    public void setIdSesion(Integer idSesion) {
        this.idSesion = idSesion;
    }

    public String getFecha() {
        return fecha;
    }

    public void setFecha(String fecha) {
        this.fecha = fecha;
    }

    public String getEvolucionLogros() {
        return evolucionLogros;
    }

    public void setEvolucionLogros(String evolucionLogros) {
        this.evolucionLogros = evolucionLogros;
    }

    public String getProgresoTerapia() {
        return progresoTerapia;
    }

    public void setProgresoTerapia(String progresoTerapia) {
        this.progresoTerapia = progresoTerapia;
    }

    public String getRecomendaciones() {
        return recomendaciones;
    }

    public void setRecomendaciones(String recomendaciones) {
        this.recomendaciones = recomendaciones;
    }

    public String getVideo() {
        return video;
    }

    public void setVideo(String video) {
        this.video = video;
    }

    public String getEstado() {
        return estado;
    }

    public void setEstado(String estado) {
        this.estado = estado;
    }

    public List<Tratamiento> getTratamientoList() {
        return tratamientoList;
    }

    public void setTratamientoList(List<Tratamiento> tratamientoList) {
        this.tratamientoList = tratamientoList;
    }

    public Informe getInforme() {
        return informe;
    }

    public void setInforme(Informe informe) {
        this.informe = informe;
    }

    public Paciente getPaciente() {
        return paciente;
    }

    public void setPaciente(Paciente paciente) {
        this.paciente = paciente;
    }

    public Fisioterapeuta getFisioterapeuta() {
        return fisioterapeuta;
    }

    public void setFisioterapeuta(Fisioterapeuta fisioterapeuta) {
        this.fisioterapeuta = fisioterapeuta;
    }

    public List<Comentariovideo> getComentariovideoList() {
        return comentariovideoList;
    }

    public void setComentariovideoList(List<Comentariovideo> comentariovideoList) {
        this.comentariovideoList = comentariovideoList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idSesion != null ? idSesion.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Sesion)) {
            return false;
        }
        Sesion other = (Sesion) object;
        if ((this.idSesion == null && other.idSesion != null) || (this.idSesion != null && !this.idSesion.equals(other.idSesion))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Persistencia.Sesion[idSesion=" + idSesion + "]";
    }

}
